﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;
using Kristall.MyGame.Enemies;
using Kristall.Engine.Behaviors;

namespace Kristall.Engine
{
    public abstract class NPC : Actor
    {
        [XmlIgnore]
        public Behavior CurrentBehavior;

        public NPC() : base()
        {
            this.CheckWorldCollision = true;
        }

        public override void RemoveFromLevel()
        {
            Level.NPCs.Remove(this);
        }

        public override void AddToLevel()
        {
            if (this.Id.Equals("Id_not_set"))
                this.Id = "Enemy" + Level.NPCs.Count;

            Level.NPCs.Add(this);
        }

        public override void Update(float dt)
        {
            if (CurrentBehavior != null)
                CurrentBehavior.Update(dt);

            base.Update(dt);
        }
    }
}
